#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    InitialUi();
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::InitialUi()
{
    paramFilePath = qApp->applicationDirPath()+"/Parameters/Softprep.xml";
    QObject::connect(LanguageLib::getinstance(), &LanguageLib::languageChanged,   this, &MainWindow::language_change_slot);
    language_change_slot();
    language =  LanguageLib::getinstance()->getLanguage();

    XmlFileHelper *xml =  new XmlFileHelper(paramFilePath);

    QDomDocument doc =xml->OpenXmlFile("SoftRep");
    QDomNode root = doc.documentElement();
    qDebug()<< root.toElement().tagName();

    qDebug()<< xml->FindChildNode(root, "DATA2").toElement().attribute("RDJLA");
}

void MainWindow::language_change_slot()
{
    ui->retranslateUi(this);
}
